from sakucrm import models
from stack.service.stack import StackConfig
from stack.service.stack import get_choice_text
from stack.service.stack import Option
from django import forms
from django.shortcuts import HttpResponse
from django.conf import settings
from django.db import transaction


class ClassListConfig(StackConfig):
    '''
    班级信息
    '''
    def display_title(self,row=None,header=False):
        if header:
            return '班级'
        return '{}-{}'.format(row.course.name,row.semester)
    def display_startdata(self,row=None,header=False):
        if header:
            return '开班日期'
        return row.start_date.strftime('%Y-%m-%d')

    list_display = ['id','school',display_title,display_startdata]
